<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="tag" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<!DOCTYPE html>
<html>
<tag:head title="我的借阅历史" ctx="${ctx}">
</tag:head>

<tag:body>
	<!-- 左 上 导航 -->
	<tag:nav ctx="${ctx}"></tag:nav>

	<!-- page content -->
	<div class="right_col" role="main">
		<div class="">
			<div class="clearfix"></div>

			<div class="row">
				<div class="col-md-12 col-sm-12 col-xs-12">
					<div class="x_panel">
						<div class="x_title">
							<h2>我的历史借阅</h2>
							<div class="clearfix"></div>
						</div>
						<div class="x_content">
							<table id="datatable-checkbox" class="table table-striped table-bordered bulk_action">
								<thead>
									<tr>
									<th width="5%">序号</th>
									<th width="7%" style="display: none;">ID</th>
									<%--<th width="10%">员工号</th>--%>
									<%--<th width="10%">员工名称</th>--%>
									<%--<th width="10%">图书号</th>--%>
									<th width="10%">图书名称</th>
									<th width="10%">类别</th>
									<th width="10%">作者</th>
									<th width="10%">出版社</th>
									<th width="10%">封面图</th>
									<th>开始时间</th>
									<th>结束时间</th>
									<th>借阅总时间</th>
									<th>状态</th>
									<th>最后处理的管理员</th>
									<th>操作</th>
								</tr>
								</thead>

								<tbody>
									<c:forEach var="borrow" items="${requestScope.borrows}" varStatus="status">
										<tr>
											<td width="5%">${status.index + 1}</td>
											<td width="7%" style="display: none;">${borrow.borrowId}</td>
											<%--<td width="10%">${borrow.staff.staffId}</td>--%>
											<%--<td width="10%">${borrow.staff.name}</td>--%>
											<%--<td width="10%">${borrow.book.bookId}</td>--%>
											<td width="10%">${borrow.book.name}</td>
											<td width="10%">${borrow.book.bookClass.name}</td>
											<td width="10%">${borrow.book.author}</td>
											<td width="10%">${borrow.book.publish}</td>
											<td width="5%"><a href="#" class="btn btn-info btn-xs" data-toggle='modal' data-target='.bigImage' onclick="bigImage('${ctx}/${borrow.book.bookImage}')">
												查看大图</a>
											</td>
											<td>${borrow.startDate}</td>
											<td>${borrow.endDate}</td>
											<td>${borrow.borrowDays}</td>
											<td>
												<span class="label label-default">已归还</span>
											</td>
											<td>${borrow.admin.name}</td>
											<td><a href='#' class='btn btn-info btn-xs' onclick='evalueBook(this)'>
													<i class='fa fa-pencil'></i>
													评价
											</a></td>
										</tr>
								</c:forEach>
								</tbody>
							</table>
							<div class="dataTables_paginate paging_simple_numbers" id="datatable-checkbox_paginate">
								<ul class="pagination">
									<li class="paginate_button previous disabled" id="datatable-checkbox_previous">
										<a href="javascript:void(0)" aria-controls="datatable-checkbox" data-dt-idx="0" tabindex="0">上一页</a>
									</li>
									<li class="paginate_button next disabled" id="datatable-checkbox_next">
										<a href="javascript:void(0)" aria-controls="datatable-checkbox" data-dt-idx="2" tabindex="0">下一页</a>
									</li>
								</ul>
							</div>
						</div>
					</div>
				</div>

			</div>


		</div>
	</div>
	<!-- /page content -->

	<!-- footer content -->
	<tag:footer></tag:footer>
</tag:body>
<!-- javascript -->
<tag:javascript ctx="${ctx}">
	<!-- this page -->
	<script src="${ctx}/assets/js/staff/staff_book_history/staff_book_history.js"></script>
	<script>
		<c:if test="${requestScope.error != null}">
		createPNotify("提示信息","error","${requestScope.error}");
		</c:if>

		initTable();

		<c:choose>
			<c:when test="${requestScope.page.pageSize == 10 || requestScope.page.pageSize == 50 || requestScope.page.pageSize == 25 || requestScope.page.pageSize == 100}">
				$("#pageSize").val(${requestScope.page.pageSize});
			</c:when>
		<c:otherwise>
			$("#pageSize").val("all");
		</c:otherwise>
		</c:choose>

		createPaging($('#datatable-checkbox_paginate'),${requestScope.page.currentPageNum},${requestScope.page.totalPageNum},'historyBorrow(this)',10);
		adjustPagination($("#datatable-checkbox_paginate").children("ul"),${requestScope.page.currentPageNum},${requestScope.page.totalPageNum});
	</script>
</tag:javascript>
</html>

<!-- start:评价图书 -->
<div class="modal fade bs-example-modal-db" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-sm">
		<div class="modal-content">

			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
						aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title">评价图书</h4>
			</div>
			<div class="modal-body">
				<h4>确定删除选定的？</h4>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"></label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<h4 class="info">成功或失败提示</h4>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary">确定</button>
			</div>

		</div>
	</div>
</div>
<!-- end:删除图书 -->

<!-- start:删除多个图书 -->
<div class="modal fade bs-example-modal-dbg" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-sm">
		<div class="modal-content">

			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
						aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title" id="myModalLabel2">删除图书</h4>
			</div>
			<div class="modal-body">
				<h4>确定删除选定的？</h4>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"></label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<h4 class="info">成功或失败提示</h4>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary">确定</button>
			</div>

		</div>
	</div>
</div>
<!-- end:删除多个图书 -->

<!-- start:bigImage -->
<div class="modal fade bigImage" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-sm">
		<div class="modal-content">
			<img src="" width="300px" height="300px">
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>

		</div>
	</div>
</div>
<!-- end:bigImage -->